<?php

namespace LDL\Twspider\C\Timer;

use LDL\Twspider\C\Timer\TimeRun;
use LDL\Twspider\C\Timer\ThreadJob;
use LDL\Twspider\C\Timer\TimeJob;
//use VDB\Spider\Spider;
use VDB\Spider\Stackable;
/**
 * but , it's not threaded also ,fucking  
 */
trait TraitThreadjob {
	private $job ;
	public function __construct($t,$cal){
		$this->job = new TimeJob($t,$cal);
	}

	public 	static function __callStatic($method,$arguments){
		return call_user_func_array(array(TraitThreadjob::class, $method),  $arguments);

	///	echo "$method\n" ;
	}
	
	public function run(){
	}

	public function __call($method, $arguments){
		return call_user_func_array(array($this->job, $method),  $arguments);
		//echo  $method."is not found \n";
	}


}
class ThreadJob extends \Threaded
{
	use TraitThreadjob ;
	public static  function getInstance($micro_seconds,$func){
		return new TimeRun(new ThreadJob($micro_seconds,$func));
	}
	
}

